package com.daoyin.ssph.service.impl;

import java.util.List;

import com.daoyin.ssph.bean.Administrator;
import com.daoyin.ssph.dao.AdministratorDAO;
import com.daoyin.ssph.service.AdminService;

public class AdminServiceImpl extends BaseServiceImpl<Administrator> implements AdminService{
	private AdministratorDAO dao;

	public void setDao(AdministratorDAO dao) {
		this.dao = dao;
	}
	
	@SuppressWarnings("unchecked")
	public String query(Administrator admin){
		Administrator administrator = new Administrator();
		List<Administrator> list = dao.findAll();
		
		Administrator user = list.get(0);
		if(admin.getName().equals(user.getName())){
			if(admin.getPassword().equals(user.getPassword())){
				return "success";
			}else{
				return "padfail";
			}
		}
		return "success";
	}
}	
